require('page/common/header/index.js');
var _util = require('../../util/util.js');
var _catalog_service = require('service/catalog-service.js');


var searchProducts = JSON.parse(window.sessionStorage.getItem("searchProduct"));
console.log(searchProducts.length);
var table = document.getElementById("searchProductTable");
var str = '<tr><th></th><th>Product ID</th><th>Name</th></tr>';
if(searchProducts!==null&&searchProducts!==undefined){
    for(var i=0;i<searchProducts.length;i++){
        str += '<tr><td><a href="./catalog-list.html?id='+searchProducts[i].productId+'&route=item&categoryId='+searchProducts[i].categoryId+'">'+searchProducts[i].description+'</a>'+'</td>'
                +'<td><a href="./catalog-list.html?id='+searchProducts[i].productId+'&route=item&categoryId='+searchProducts[i].categoryId+'">'+searchProducts[i].productId+'</a>'+'</td>'
                +'<td>'+searchProducts[i].name+'</td>'
                +'</tr>'
    }
    table.innerHTML = str;
}